<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对象属性的简写</title>
</head>
<body>
    <script>
        var name = "cq";
        var age = 18;
        var key = "address";
        obj = {
            name,
            age,
            [key]:"广州"
        }

        console.log(obj.name);
        console.log(obj.address);
    </script>
</body>
</html>